//
//  ContentTableView.m
//  星期一
//
//  Created by 来定MAC on 15/8/6.
//  Copyright (c) 2015年 LD. All rights reserved.
//

#import "ContentTableView.h"
#import "HeadViewWithContentV.h"
#import "UIView+SimpleFrame.h"
#import "ContentTVCell.h"


@interface ContentTableView ()<UITableViewDataSource>

@property(nonatomic,weak)HeadViewWithContentV *headView;

@end

@implementation ContentTableView

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        self.dataSource = self;
        //头视图
        HeadViewWithContentV *headView = [[HeadViewWithContentV alloc] init];
        headView.height = 80;
        self.tableHeaderView = headView;
        self.headView = headView;
        //cell
        [self registerNib:[UINib nibWithNibName:@"ContentTVCell" bundle:nil] forCellReuseIdentifier:@"ID"];
        
    }
    return self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.venuseModelArr count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellID = @"ID";
    ContentTVCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[ContentTVCell alloc] init];
    }
    //防止空异常
    if ([self.venuseModelArr count] > 0) {
        cell.dateModel = [self.venuseModelArr objectAtIndex:indexPath.row];
    }
    return cell;
}


@end
